# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=openredir
pkgver=1.0
pkgrel=1
pkgdesc="Redirect file open operations via LD_PRELOAD"
arch=("loong64" "x86_64")
url="https://github.com/lilydjwg/openredir"
license=("BSD")
depends=('lua' 'python')
source=(https://github.com/lilydjwg/openredir/archive/v$pkgver/openredir-$pkgver.tar.gz)
sha512sums=('022f51114005442ab464f7a26eb0ce90d0927450031dfb7994d0390cf53659640cef60f4814bc53e827b2f152698e4a16d2745787c3b78147aab37a469a94526')

build() {
  cd $pkgname-$pkgver
  ./autogen.sh
  ./configure --prefix=/usr
  make
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install

  install -Dm755 openredir-cli -t "$pkgdir"/usr/bin/
  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}
